package dbops;

import java.util.ArrayList;

import dbops.COLUMN.DATA_TYPE;

/**
 * Description : Functional Test Script
 * 
 * @author angel.tsvetkov
 */
public class ROW extends ArrayList<CELL> {
	private static final long serialVersionUID = 1L;

	/**
	 * Insert cell in the row. Inserted cell is placed on the last position.
	 * 
	 * @param cell
	 *            cell which will be inserted.
	 */
	public void insert(CELL cell) {
		this.add(cell);
	}

	/**
	 * Insert cell in the row. Inserted cell is placed on the specified
	 * position.
	 * 
	 * @param cell
	 *            cell which will be inserted.
	 */
	public void insertAt(int position, CELL cell) {
		this.add(position, cell);
	}

	/**
	 * Insert whole row cell by cell.
	 * 
	 * @param cells
	 *            cells which will be inserted in the row.
	 */
	public void insert(CELL... cells) {
		for (CELL cell : cells) {
			this.add(cell);
		}
	}

	/**
	 * Insert cell by passing its type value and column as arguments.Inserted
	 * cell is placed on the last position.
	 * 
	 * @param type
	 *            DATA_TYPE of the cell.
	 * @param value
	 *            value of the cell.
	 * @param column
	 *            column in which the cell belong.
	 */
	public void insert(String value, COLUMN column) {
		this.add(new CELL(value, column));
	}

	/**
	 * Insert cell by passing its type value and column as arguments.Inserted
	 * cell is placed on the specified position.
	 * 
	 * @param type
	 *            DATA_TYPE of the cell.
	 * @param value
	 *            value of the cell.
	 * @param column
	 *            column in which the cell belong.
	 */
	public void insertAt(int position, String value,
			COLUMN column) {
		this.add(position, new CELL(value, column));
	}

	/**
	 * Insert cell by passing its type value and column as arguments.Inserted
	 * cell is placed on the last position.
	 * 
	 * @param type
	 *            DATA_TYPE of the cell.
	 * @param value
	 *            value of the cell.
	 */
	public void insert(DATA_TYPE type, String value) {
		this.add(new CELL(type, value));
	}

	/**
	 * Insert cell by passing its type value and column as arguments.Inserted
	 * cell is placed on the specified position.
	 * 
	 * @param type
	 *            DATA_TYPE of the cell.
	 * @param value
	 *            value of the cell.
	 */
	public void insertAt(int position, DATA_TYPE type, String value) {
		this.add(position, new CELL(type, value));
	}
}
